<template>
	<view>
			<view v-for="(i, index) in data" :key="index">
			<view v-if="i.id==inde">
				<uni-card >
					<text class="title">{{i.title}}</text>
				</uni-card>
				<uni-card >
					<text class="uni-body">{{i.memo}}</text>
				</uni-card>
				<view v-if="i.uri!=null">
					<view v-for="(i, index) in i.uri" :key="index">
					<image :src="'http://xg.kystu.cn:8085'+i"></image>
					</view>
				</view>
			</view>
			</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				data: [
				],
				inde: '',
				id:"",
				title:"",
				state:"",
			}
		},
		methods: {
			onLoad(option){
				this.id = option.id
				this.title = option.title
				this.state = option.state
			},
			onShow() {
				var _this = this;
				uni.getStorage({
					key: 'App-Token',
					success(res) {
						_this.token = res.data;
						uni.request({
							url: 'http://xg.kystu.cn:8085/system/example_cj/list',
							method: 'GET',
							data:{
								id : _this.id,
								title : _this.title,
								state : _this.state,
							},
							header: {
								'Authorization': "Bearer " + _this.token
							},
							success: (res) => {
								if (res.data.code == 200) {
									_this.data=[]
									for(var i=0;i<res.data.total;i++){
									_this.data.push({'title':'','memo':'','uri':'','updatetime':'','username':'','id':''})
									console.log(res.data.rows[i].title)
									_this.data[i].title = res.data.rows[i].title;
									_this.data[i].memo = res.data.rows[i].mycontent;
									// var m = res.data.rows[i].upimage.split(",");
									_this.data[i].uri = m;
									// 'http://xg.kystu.cn:8085' 
									_this.data[i].updatetime = res.data.rows[i].updatetime;
									_this.data[i].username = res.data.rows[i].username;
									_this.data[i].id =res.data.rows[i].id;
								}
								}
						
							}
						})
					}
				})
			}
		}
	}
</script>

<style>
.title{
	font-size: 80rpx;
    text-align: center;
	color: black;
	display: block;
}
</style>
